package com.wiscamp.ninechapters.problems.domain.models.problems.questions;

import com.wiscamp.ninechapters.problems.domain.models.problems.answers.Answer;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.Collection;

/**
 * 计算问题
 * 计算题型-整数
 * 计算题型-商及余数
 * 计算题型-分数
 * 计算题型-通分
 * 计算题型-有限小数
 * 计算题型-循环小数
 * 计算题型-百分数
 * 计算题型-根数
 * 计算题型-近似数
 * 计算题型-有理数
 * 计算题型-表达式
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class CalculationQuestion extends Question {
    /**
     * 问题答案
     */
    private Answer answer;


    @Override
    public void setCurrentAnswer(Answer answer) {
        this.answer = answer;
    }

    @Override
    public Answer getCurrentAnswer() {
        return this.answer;
    }

    @Override
    public Collection<Answer> getCurrentAnswers() {
        var answers = new ArrayList<Answer>();
        answers.add(this.answer);
        return answers;
    }
}
